﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XiTongAddEmp.aspx.cs" Inherits="PropertyAppraisal.SystemManage.XiTongAddEmp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
  <%--  <link rel="stylesheet" type="/text/css" href="../easyui/easyui/1.3.2/themes/default/easyui.css" />
    <link rel="stylesheet" type="/text/css" href="../easyui/easyui/1.3.2/themes/icon.css" />
    <script src="../easyui/easyui/1.3.2/jquery-1.8.0.min.js"></script>
   
    <script type="/text/javascript" src="../easyui/easyui/1.3.2/jquery.easyui.min.js"></script>
    <script src="../easyui/easyui/1.3.2/easyloader.js"></script>--%>

     <link href="../jquery-easyui-1.3.5/themes/default/easyui.css" rel="stylesheet" />
   <link href="../easyui/easyui/1.3.2/themes/icon.css" rel="stylesheet" />
    <script type="text/javascript" src="../jquery-easyui-1.3.5/jquery-1.7.2-min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.3.5/easyloader.js"></script>
    <script src="../easyui/easyui/1.3.2/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
    <%--<h2>借款人员基本信息</h2>--%>
    <div class="demo-info">
        <div class="demo-tip icon-tip"></div>
        <%--<div>Fill the form and submit it.</div>--%>
    </div>
    <div style="margin: 0;"></div>
    <form id="form1" runat="server">
        <div class="easyui-panel" fit="true" style="border: none;">
            <div style="margin-left: 30px;" id="ff">
                    <iframe width="0" height="0" src="../SessionKeeper.aspx"></iframe>   
                <div>
                    <span>添加员工基本信息：</span>
                </div>
                <br />
                <br />
                <div>
                    <table>
                        <tr>
                            <td>员工姓名：</td>
                            <td style="padding-left: 50px;">
                                <input class="easyui-validatebox" missingMessage="必填" type="text" id="name" name="linkmen" data-options="required:true" style="width: 800px;" placeholder="请输入员工姓名" maxlength="20" /></td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>性别：</td>
                            <td style="padding-left: 50px;">
                                <input type="radio" value="1" name="sex"  />男
                                <input type="radio" value="0" name="sex" />女
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>身份证号：</td>
                            <td style="padding-left: 50px;">
                                <input class="easyui-textbox"  missingMessage="必填" id="card" type="text" name="overyears" data-options="required:true" style="width: 800px;" placeholder="请输入员工身份证号" maxlength="20" /></td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>手机：</td>
                            <td style="padding-left: 50px;">
                                <input class="easyui-textbox" missingMessage="必填" id="phone" type="text" name="overyears" data-options="required:true" style="width: 800px;" placeholder="请输入员工手机号" maxlength="20" /></td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>邮箱：</td>
                            <td style="padding-left: 50px;">
                                <input class="easyui-textbox"  missingMessage="必填" id="email" type="text" name="moneynum" data-options="required:true" style="width: 800px;" placeholder="请输入员工邮箱" maxlength="40" /></td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>员工账号：</td>
                            <td style="padding-left: 50px;">
                                <input class="easyui-validatebox" missingMessage="必填" id="account" type="text" name="houseaddr" data-options="required:true" style="width: 800px;" placeholder="请输入员工账号" maxlength="40" /></td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>角色：</td>
                            <td id="juese" style="padding-left: 50px;">
                                 <select class="easyui-combobox" style="width: 800px;" id="select3"  data-options="editable:false">
                                     <option value="0">--请选择--</option>
                                     <option value="1">接单</option>
                                     <option value="2">外业勘察</option>
                                     <option value="3">内业估价</option>
                                     <option value="4">审核</option>
                            </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>部门：</td>
                            <td id="bumen" style="padding-left: 50px;">
                                <select class="easyui-combobox" style="width: 800px;" id="select4"  data-options="editable:false">
                                <option>--请选择--</option>
                                <%=departmentBD() %>
                            </select>
                                
                            </td>
                        </tr>
                        
                    </table>
                </div>
                <div style="text-align: center; padding: 5px">
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="btn" ">提交</a> 
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script>
    $('#btn').bind('click', function () {
        var name = $("#name").val();
        var sex = $(":radio:checked").val();
        var card = $("#card").val();
        var phone = $("#phone").val();
        var email = $("#email").val();
        var account = $("#account").val();
        var juese = $("#select3").combobox('getValue')//获取角色
        var bumen = $("#select4").combobox('getValue')//获取部门
        
        $.ajax({
            type: "post",
            url: "XiTongAddEmp.aspx/AddEmp",
            data: "{'name':'" + name + "','sex':'" + sex + "','card':'" + card + "','phone':'" + phone + "','email':'" + email + "','account':'" + account + "','juese':'" + juese + "','bumen':'" + bumen + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            async: false,
            success: function (obj) {
        
                if (obj) {
                  
                    $.messager.alert('提示信息', '增加成功', 'info', function () {

                        parent.removeTab();
                        parent.addTab("用户管理", "/SystemManage/XiTongUser.aspx", "icon-chart-organisation", true);

                    });
                }
                else {
                    $.messager.alert('提示信息', '增加失败');
                }
            }
        })
    });
</script>
